<?php

namespace app\admin\model;

use think\Model;

class Teacher extends Model
{
    //注册时间
    protected $autoWriteTimestamp = 'datetime';

    /**
     * 判断用户是否存在
     * @param $username
     * @return bool
     */
    public function isExist($name)
    {
        if (empty($name)) {
            return false;
        }
        $info = $this->where('username', $name)->find();
        return (bool)$info;
    }
}